HASTHI_HOME="/u/hperera/svncode/management/"

export HASTHI_HOME

DIRLIBS="${HASTHI_HOME}/target/dist-bin/lib/*.jar"
for i in ${DIRLIBS}
do
   CLASSPATH="$i":$CLASSPATH
done
CLASSPATH=${HASTHI_HOME}/target/classes:$CLASSPATH


cd ${HASTHI_HOME}

MEM_LIMIT="256"
CHANGE_PROB="0.10 0.25 0.50 0.75"
RESOURCE_COUNTS="100 200 300 500 750 1000 2000 5000 7500 10000 12500 15000 17500 20000 25000 30000 35000 40000 50000 60000 70000 80000 90000 100000"
RULE_FILES="/u/hperera/svncode/management/resources/rules/lead4.drl /u/hperera/svncode/management/resources/rules/lead8.drl"


for f in ${RULE_FILES}; do 
	LOG_FILE=logs/perf-`date +%m_%d_%H_%M`.log
	echo $f  $HOSTNAME >> $LOG_FILE
	echo $LOG_FILE  $f  $HOSTNAME
	for p in ${CHANGE_PROB}; do
		echo '############################ Change Probability $p ###############################'
		for m in ${MEM_LIMIT}; do
			for r in ${RESOURCE_COUNTS}; do
				echo "[ Sustained Mem =" $m " Resource Count=" $r $p " ]">> $LOG_FILE
				java -Xmx${m}m -cp $CLASSPATH hasthi.tools.analyze.RulesSustainedTest  $f $r $p >> $LOG_FILE
			done	
		done
	done		
done
echo "----------------------------- Completed ---------------------------------">> $LOG_FILE

